From 9482f8e2b76ce044dab9243d6107e5b03fab4e39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 30 May 2012 14:09:18 +0000 Subject: [PATCH] use sax::Converter:: base64 code instead MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I92fd4459bed7c38ff2063899b20d24d781ac45b From b9f83fca37a3544b825de9d2f295090257d3477b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 02 Jun 2012 22:14:45 +0000 Subject: ThreeByteToFourByte and friends are no longer in use Change-Id: I9a2aaebfc5cc6b8b6327d61270043611283a6975 Gbp-Pq: Name CVE-2012-2665-binfilter.diff --- .../xml/sc_XMLChangeTrackingExportHelper.cxx | 5 +- .../xml/sc_XMLTrackedChangesContext.cxx | 5 +- .../bf_sc/source/filter/xml/sc_xmlbodyi.cxx | 5 +- .../bf_sc/source/filter/xml/sc_xmlexprt.cxx | 5 +- .../bf_sc/source/filter/xml/sc_xmlsubti.cxx | 4 +- binfilter/bf_sc/util/makefile.mk | 1 + .../core/xmloff_DocumentSettingsContext.cxx | 6 +- .../core/xmloff_SettingsExportHelper.cxx | 3 +- .../source/core/xmloff_XMLBase64Export.cxx | 4 +- .../core/xmloff_XMLBase64ImportContext.cxx | 5 +- .../bf_xmloff/source/core/xmloff_xmluconv.cxx | 175 ------------------ .../source/text/xmloff_XMLRedlineExport.cxx | 3 +- .../source/text/xmloff_XMLSectionExport.cxx | 4 +- .../text/xmloff_XMLSectionImportContext.cxx | 4 +- .../text/xmloff_XMLTextFrameContext.cxx | 4 +- .../xmloff_XMLTrackedChangesImportContext.cxx | 3 +- binfilter/bf_xmloff/util/makefile.mk | 1 + binfilter/inc/bf_xmloff/xmluconv.hxx | 11 -- 18 files changed, 41 insertions(+), 207 deletions(-) diff --git a/binfilter/bf_sc/source/filter/xml/sc_XMLChangeTrackingExportHelper.cxx b/binfilter/bf_sc/source/filter/xml/sc_XMLChangeTrackingExportHelper.cxx index 2916fa79c0f..4b878dc65fb 100644 --- a/binfilter/bf_sc/source/filter/xml/sc_XMLChangeTrackingExportHelper.cxx +++ b/binfilter/bf_sc/source/filter/xml/sc_XMLChangeTrackingExportHelper.cxx @@ -39,6 +39,9 @@ #include #include + +#include + namespace binfilter { #define SC_CHANGE_ID_PREFIX "ct" @@ -758,7 +761,7 @@ void ScChangeTrackingExportHelper::CollectAndWriteChanges() if (pChangeTrack->IsProtected()) { ::rtl::OUStringBuffer aBuffer; - SvXMLUnitConverter::encodeBase64(aBuffer, pChangeTrack->GetProtection()); + ::sax::Converter::encodeBase64(aBuffer, pChangeTrack->GetProtection()); if (aBuffer.getLength()) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); } diff --git a/binfilter/bf_sc/source/filter/xml/sc_XMLTrackedChangesContext.cxx b/binfilter/bf_sc/source/filter/xml/sc_XMLTrackedChangesContext.cxx index 44564807ba8..b5d495c41d2 100644 --- a/binfilter/bf_sc/source/filter/xml/sc_XMLTrackedChangesContext.cxx +++ b/binfilter/bf_sc/source/filter/xml/sc_XMLTrackedChangesContext.cxx @@ -47,6 +47,9 @@ #include #include + +#include + namespace binfilter { using namespace ::com::sun::star; @@ -562,7 +565,7 @@ ScXMLTrackedChangesContext::ScXMLTrackedChangesContext( ScXMLImport& rInImport, if (sValue.getLength()) { uno::Sequence aPass; - SvXMLUnitConverter::decodeBase64(aPass, sValue); + ::sax::Converter::decodeBase64(aPass, sValue); pChangeTrackingImportHelper->SetProtection(aPass); } } diff --git a/binfilter/bf_sc/source/filter/xml/sc_xmlbodyi.cxx b/binfilter/bf_sc/source/filter/xml/sc_xmlbodyi.cxx index fb518067ac2..42a4e2e148b 100644 --- a/binfilter/bf_sc/source/filter/xml/sc_xmlbodyi.cxx +++ b/binfilter/bf_sc/source/filter/xml/sc_xmlbodyi.cxx @@ -56,6 +56,9 @@ #include #include + +#include + namespace binfilter { using namespace ::com::sun::star; @@ -193,7 +196,7 @@ void ScXMLBodyContext::EndElement() { uno::Sequence aPass; if (sPassword.getLength()) - SvXMLUnitConverter::decodeBase64(aPass, sPassword); + ::sax::Converter::decodeBase64(aPass, sPassword); pDoc->SetDocProtection(bProtected, aPass); } uno::Reference xSpreadDoc( GetScImport().GetModel(), uno::UNO_QUERY ); diff --git a/binfilter/bf_sc/source/filter/xml/sc_xmlexprt.cxx b/binfilter/bf_sc/source/filter/xml/sc_xmlexprt.cxx index 59e571aa416..6823ff72059 100644 --- a/binfilter/bf_sc/source/filter/xml/sc_xmlexprt.cxx +++ b/binfilter/bf_sc/source/filter/xml/sc_xmlexprt.cxx @@ -86,6 +86,7 @@ #include #include #include +#include namespace binfilter { //! not found in unonames.hxx #define SC_STANDARDFORMAT "StandardFormat" @@ -1213,7 +1214,7 @@ void ScXMLExport::SetBodyAttributes() { AddAttribute(XML_NAMESPACE_TABLE, XML_STRUCTURE_PROTECTED, XML_TRUE); ::rtl::OUStringBuffer aBuffer; - SvXMLUnitConverter::encodeBase64(aBuffer, pDoc->GetDocPassword()); + ::sax::Converter::encodeBase64(aBuffer, pDoc->GetDocPassword()); if (aBuffer.getLength()) AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); } @@ -1285,7 +1286,7 @@ void ScXMLExport::_ExportContent() AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE); ::rtl::OUStringBuffer aBuffer; if (pDoc) - SvXMLUnitConverter::encodeBase64(aBuffer, pDoc->GetTabPassword(nTable)); + ::sax::Converter::encodeBase64(aBuffer, pDoc->GetTabPassword(nTable)); if (aBuffer.getLength()) AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); } diff --git a/binfilter/bf_sc/source/filter/xml/sc_xmlsubti.cxx b/binfilter/bf_sc/source/filter/xml/sc_xmlsubti.cxx index b517fb0341a..f53aacbfb5c 100644 --- a/binfilter/bf_sc/source/filter/xml/sc_xmlsubti.cxx +++ b/binfilter/bf_sc/source/filter/xml/sc_xmlsubti.cxx @@ -45,6 +45,8 @@ #include #include #include + +#include namespace binfilter { //------------------------------------------------------------------ @@ -593,7 +595,7 @@ void ScMyTables::DeleteTable() if (rImport.GetDocument() && bProtection) { uno::Sequence aPass; - SvXMLUnitConverter::decodeBase64(aPass, sPassword); + ::sax::Converter::decodeBase64SomeChars(aPass, sPassword); rImport.GetDocument()->SetTabProtection(nCurrentSheet, bProtection, aPass); /*uno::Reference xProtectable(xCurrentSheet, uno::UNO_QUERY); if (xProtectable.is()) diff --git a/binfilter/bf_sc/util/makefile.mk b/binfilter/bf_sc/util/makefile.mk index bbe72863d45..ca55b96fc02 100644 --- a/binfilter/bf_sc/util/makefile.mk +++ b/binfilter/bf_sc/util/makefile.mk @@ -71,6 +71,7 @@ SHL1STDLIBS+= \ $(BFSVXLIB) \ $(BFOFALIB) \ $(VCLLIB) \ + $(SAXLIB) \ $(CPPULIB) \ $(CPPUHELPERLIB) \ $(COMPHELPERLIB) \ diff --git a/binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx b/binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx index 3ffa5d55365..e8b653883ab 100644 --- a/binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx +++ b/binfilter/bf_xmloff/source/core/xmloff_DocumentSettingsContext.cxx @@ -37,9 +37,7 @@ #include "xmluconv.hxx" #include -#ifndef __SGI_STL_LIST #include -#endif #include #include @@ -48,6 +46,7 @@ #include #include #include +#include #include namespace binfilter { @@ -516,8 +515,7 @@ void XMLConfigItemContext::Characters( const ::rtl::OUString& rChars ) } uno::Sequence aBuffer((sChars.getLength() / 4) * 3 ); sal_Int32 nCharsDecoded = - GetImport().GetMM100UnitConverter(). - decodeBase64SomeChars( aBuffer, sChars ); + ::sax::Converter::decodeBase64SomeChars(aBuffer, sChars); sal_uInt32 nStartPos(aDecoded.getLength()); sal_uInt32 nCount(aBuffer.getLength()); aDecoded.realloc(nStartPos + nCount); diff --git a/binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx b/binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx index a60824a3c74..f7fbcfd26bb 100644 --- a/binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx +++ b/binfilter/bf_xmloff/source/core/xmloff_SettingsExportHelper.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include namespace binfilter { @@ -355,7 +356,7 @@ void XMLSettingsExportHelper::exportbase64Binary( if(nLength) { ::rtl::OUStringBuffer sBuffer; - SvXMLUnitConverter::encodeBase64(sBuffer, aProps); + ::sax::Converter::encodeBase64(sBuffer, aProps); rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear()); } } diff --git a/binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx b/binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx index 73457cba26d..5e8738ab2e7 100644 --- a/binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx +++ b/binfilter/bf_xmloff/source/core/xmloff_XMLBase64Export.cxx @@ -28,6 +28,7 @@ #include +#include #include "xmluconv.hxx" #include "xmlexp.hxx" @@ -62,8 +63,7 @@ sal_Bool XMLBase64Export::exportXML( const Reference < XInputStream> & rIn ) nRead = rIn->readBytes( aInBuff, INPUT_BUFFER_SIZE ); if( nRead > 0 ) { - GetExport().GetMM100UnitConverter().encodeBase64( aOutBuff, - aInBuff ); + ::sax::Converter::encodeBase64(aOutBuff, aInBuff); GetExport().Characters( aOutBuff.makeStringAndClear() ); if( nRead == INPUT_BUFFER_SIZE ) GetExport().IgnorableWhitespace(); diff --git a/binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx b/binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx index 0f46e86458d..ced6fff0501 100644 --- a/binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx +++ b/binfilter/bf_xmloff/source/core/xmloff_XMLBase64ImportContext.cxx @@ -31,6 +31,8 @@ #include +#include + #include "XMLBase64ImportContext.hxx" namespace binfilter { @@ -82,8 +84,7 @@ void XMLBase64ImportContext::Characters( const ::rtl::OUString& rChars ) } Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 ); sal_Int32 nCharsDecoded = - GetImport().GetMM100UnitConverter(). - decodeBase64SomeChars( aBuffer, sChars ); + ::sax::Converter::decodeBase64SomeChars(aBuffer, sChars); xOut->writeBytes( aBuffer ); if( nCharsDecoded != sChars.getLength() ) sBase64CharsLeft = sChars.copy( nCharsDecoded ); diff --git a/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx b/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx index 4c7941f2da2..e25661be6ab 100644 --- a/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx +++ b/binfilter/bf_xmloff/source/core/xmloff_xmluconv.cxx @@ -1454,181 +1454,6 @@ void SvXMLUnitConverter::convertVector3D( OUStringBuffer &rBuffer, rBuffer.append(sal_Unicode(')')); } -const - sal_Char aBase64EncodeTable[] = - { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', - 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; - -const - sal_uInt8 aBase64DecodeTable[] = - { 62,255,255,255, 63, // 43-47 -// + / - - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255, 0,255,255, // 48-63 -// 0 1 2 3 4 5 6 7 8 9 = - - 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 64-79 -// A B C D E F G H I J K L M N O - - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255,255,255,255,255, // 80-95 -// P Q R S T U V W X Y Z - - 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 96-111 -// a b c d e f g h i j k l m n o - - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }; // 112-123 -// p q r s t u v w x y z - - - -void ThreeByteToFourByte (const sal_Int8* pBuffer, const sal_Int32 nStart, const sal_Int32 nFullLen, ::rtl::OUStringBuffer& sBuffer) -{ - sal_Int32 nLen(nFullLen - nStart); - if (nLen > 3) - nLen = 3; - if (nLen == 0) - { - return; - } - - sal_Int32 nBinaer; - switch (nLen) - { - case 1: - { - nBinaer = ((sal_uInt8)pBuffer[nStart + 0]) << 16; - } - break; - case 2: - { - nBinaer = (((sal_uInt8)pBuffer[nStart + 0]) << 16) + - (((sal_uInt8)pBuffer[nStart + 1]) << 8); - } - break; - default: - { - nBinaer = (((sal_uInt8)pBuffer[nStart + 0]) << 16) + - (((sal_uInt8)pBuffer[nStart + 1]) << 8) + - ((sal_uInt8)pBuffer[nStart + 2]); - } - break; - } - - sal_Unicode buf[4] = { '=', '=', '=', '=' }; - - sal_uInt8 nIndex ((nBinaer & 0xFC0000) >> 18); - buf[0] = aBase64EncodeTable [nIndex]; - - nIndex = (nBinaer & 0x3F000) >> 12; - buf[1] = aBase64EncodeTable [nIndex]; - if (nLen > 1) - { - nIndex = (nBinaer & 0xFC0) >> 6; - buf[2] = aBase64EncodeTable [nIndex]; - if (nLen > 2) - { - nIndex = (nBinaer & 0x3F); - buf[3] = aBase64EncodeTable [nIndex]; - } - } - sBuffer.append(buf, SAL_N_ELEMENTS(buf)); -} - -void SvXMLUnitConverter::encodeBase64( ::rtl::OUStringBuffer& aStrBuffer, const uno::Sequence& aPass) -{ - sal_Int32 i(0); - sal_Int32 nBufferLength(aPass.getLength()); - const sal_Int8* pBuffer = aPass.getConstArray(); - while (i < nBufferLength) - { - ThreeByteToFourByte (pBuffer, i, nBufferLength, aStrBuffer); - i += 3; - } -} - -void SvXMLUnitConverter::decodeBase64(uno::Sequence& aBuffer, const ::rtl::OUString& sBuffer) -{ -#if OSL_DEBUG_LEVEL > 0 - sal_Int32 nCharsDecoded = -#endif - decodeBase64SomeChars( aBuffer, sBuffer ); - OSL_ENSURE( nCharsDecoded == sBuffer.getLength(), - "some bytes left in base64 decoding!" ); -} - -sal_Int32 SvXMLUnitConverter::decodeBase64SomeChars( - uno::Sequence& rOutBuffer, - const ::rtl::OUString& rInBuffer) -{ - sal_Int32 nInBufferLen = rInBuffer.getLength(); - sal_Int32 nMinOutBufferLen = (nInBufferLen / 4) * 3; - if( rOutBuffer.getLength() < nMinOutBufferLen ) - rOutBuffer.realloc( nMinOutBufferLen ); - - const sal_Unicode *pInBuffer = rInBuffer.getStr(); - sal_Int8 *pOutBuffer = rOutBuffer.getArray(); - sal_Int8 *pOutBufferStart = pOutBuffer; - sal_Int32 nCharsDecoded = 0; - - sal_uInt8 aDecodeBuffer[4]; - sal_Int32 nBytesToDecode = 0; - sal_Int32 nBytesGotFromDecoding = 3; - sal_Int32 nInBufferPos= 0; - while( nInBufferPos < nInBufferLen ) - { - sal_Unicode cChar = *pInBuffer; - if( cChar >= '+' && cChar <= 'z' ) - { - sal_uInt8 nByte = aBase64DecodeTable[cChar-'+']; - if( nByte != 255 ) - { - // We have found a valid character! - aDecodeBuffer[nBytesToDecode++] = nByte; - - // One '=' character at the end means 2 out bytes - // Two '=' characters at the end mean 1 out bytes - if( '=' == cChar && nBytesToDecode > 2 ) - nBytesGotFromDecoding--; - if( 4 == nBytesToDecode ) - { - // Four characters found, so we may convert now! - sal_uInt32 nOut = (aDecodeBuffer[0] << 18) + - (aDecodeBuffer[1] << 12) + - (aDecodeBuffer[2] << 6) + - aDecodeBuffer[3]; - - *pOutBuffer++ = (sal_Int8)((nOut & 0xff0000) >> 16); - if( nBytesGotFromDecoding > 1 ) - *pOutBuffer++ = (sal_Int8)((nOut & 0xff00) >> 8); - if( nBytesGotFromDecoding > 2 ) - *pOutBuffer++ = (sal_Int8)(nOut & 0xff); - nCharsDecoded = nInBufferPos + 1; - nBytesToDecode = 0; - nBytesGotFromDecoding = 3; - } - } - else - { - nCharsDecoded++; - } - } - else - { - nCharsDecoded++; - } - - nInBufferPos++; - pInBuffer++; - } - if( (pOutBuffer - pOutBufferStart) != rOutBuffer.getLength() ) - rOutBuffer.realloc( pOutBuffer - pOutBufferStart ); - - return nCharsDecoded; -} - sal_Bool SvXMLUnitConverter::convertNumFormat( sal_Int16& rType, const OUString& rNumFmt, diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx index ffb638e1a5f..963716d567d 100644 --- a/binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx +++ b/binfilter/bf_xmloff/source/text/xmloff_XMLRedlineExport.cxx @@ -45,6 +45,7 @@ #include +#include #include "xmlnmspe.hxx" @@ -238,7 +239,7 @@ void XMLRedlineExport::ExportChangesListElements() if ( aKey.getLength() > 0 ) { OUStringBuffer aBuffer; - SvXMLUnitConverter::encodeBase64( aBuffer, aKey ); + ::sax::Converter::encodeBase64(aBuffer, aKey); rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_PROTECTION_KEY, aBuffer.makeStringAndClear() ); } diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx index 59456bcf018..348a70eadda 100644 --- a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx +++ b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionExport.cxx @@ -39,6 +39,8 @@ #include #include +#include + #include "xmlkywd.hxx" #include "xmluconv.hxx" #include "xmlexp.hxx" @@ -452,7 +454,7 @@ void XMLSectionExport::ExportRegularSectionStart( if (aPassword.getLength() > 0) { OUStringBuffer aBuffer; - SvXMLUnitConverter::encodeBase64(aBuffer, aPassword); + ::sax::Converter::encodeBase64(aBuffer, aPassword); GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_PROTECTION_KEY, aBuffer.makeStringAndClear()); } diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx index ebd58bb1cf7..e31b32848a8 100644 --- a/binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx +++ b/binfilter/bf_xmloff/source/text/xmloff_XMLSectionImportContext.cxx @@ -40,6 +40,8 @@ #include #include +#include + namespace binfilter { @@ -308,7 +310,7 @@ void XMLSectionImportContext::ProcessAttributes( } break; case XML_TOK_SECTION_PROTECTION_KEY: - SvXMLUnitConverter::decodeBase64(aSequence, sAttr); + ::sax::Converter::decodeBase64(aSequence, sAttr); bSequenceOK = sal_True; break; case XML_TOK_SECTION_PROTECT: diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx index 33dfe6cf3e2..39fde1ff686 100644 --- a/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx +++ b/binfilter/bf_xmloff/source/text/xmloff_XMLTextFrameContext.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include "xmlimp.hxx" #include "xmlnmspe.hxx" #include "xmlkywd.hxx" @@ -1111,8 +1112,7 @@ void XMLTextFrameContext::Characters( const OUString& rChars ) } Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 ); sal_Int32 nCharsDecoded = - GetImport().GetMM100UnitConverter(). - decodeBase64SomeChars( aBuffer, sChars ); + ::sax::Converter::decodeBase64SomeChars(aBuffer, sChars); xBase64Stream->writeBytes( aBuffer ); if( nCharsDecoded != sChars.getLength() ) sBase64CharsLeft = sChars.copy( nCharsDecoded ); diff --git a/binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx b/binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx index d24d31c5dbe..b5f3bbf65fb 100644 --- a/binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx +++ b/binfilter/bf_xmloff/source/text/xmloff_XMLTrackedChangesImportContext.cxx @@ -30,6 +30,7 @@ #include "XMLChangedRegionImportContext.hxx" #include #include +#include #include "xmlimp.hxx" #include "xmlnmspe.hxx" #include "nmspmap.hxx" @@ -84,7 +85,7 @@ void XMLTrackedChangesImportContext::StartElement( } else if ( IsXMLToken( sLocalName, XML_PROTECTION_KEY ) ) { Sequence aSequence; - SvXMLUnitConverter::decodeBase64( + ::sax::Converter::decodeBase64( aSequence, xAttrList->getValueByIndex(i)); if ( aSequence.getLength() > 0 ) { diff --git a/binfilter/bf_xmloff/util/makefile.mk b/binfilter/bf_xmloff/util/makefile.mk index ff6b5449314..bb803a65d83 100644 --- a/binfilter/bf_xmloff/util/makefile.mk +++ b/binfilter/bf_xmloff/util/makefile.mk @@ -69,6 +69,7 @@ SHL1IMPLIB= _ibf_xo SHL1STDLIBS= \ $(BFSVTOOLLIB) \ + $(SAXLIB) \ $(TOOLSLIB) \ $(I18NISOLANGLIB) \ $(CPPULIB) \ diff --git a/binfilter/inc/bf_xmloff/xmluconv.hxx b/binfilter/inc/bf_xmloff/xmluconv.hxx index 71dd84be550..d0d45aeb544 100644 --- a/binfilter/inc/bf_xmloff/xmluconv.hxx +++ b/binfilter/inc/bf_xmloff/xmluconv.hxx @@ -309,17 +309,6 @@ public: static sal_Int32 indexOfComma( const ::rtl::OUString& rStr, sal_Int32 nPos ); - static void encodeBase64( ::rtl::OUStringBuffer& aStrBuffer, const ::com::sun::star::uno::Sequence& aPass); - - // Decode a base 64 encoded string into a sequence of bytes. The first - // version can be used for attribute values only, bacause it does not - // return any chars left from conversion. - // For text submitted throgh the SAX characters call, the later method - // must be used! - static void decodeBase64( ::com::sun::star::uno::Sequence& aPass, const ::rtl::OUString& sBuffer); - - static sal_Int32 decodeBase64SomeChars( ::com::sun::star::uno::Sequence& aPass, const ::rtl::OUString& sBuffer); - /** convert num-forat and num-letter-sync values to NumberingType */ sal_Bool convertNumFormat( sal_Int16& rType, const ::rtl::OUString& rNumFormat, -- 2.30.2